"use strict";
cc._RF.push(module, '6e0cfz/xSxEjYJAIhs65sT5', 'RedPoint');
// scripts/RedPoint.js

"use strict";

var t = require;
var e = module;
var o = exports;

var _i,
    n = void 0 && (void 0).__extends || (_i = function i(t, e) {
  return (_i = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (t, e) {
    t.__proto__ = e;
  } || function (t, e) {
    for (var o in e) {
      Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
    }
  })(t, e);
}, function (t, e) {
  function o() {
    this.constructor = t;
  }

  _i(t, e), t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o());
}),
    a = void 0 && (void 0).__decorate || function (t, e, o, i) {
  var n,
      a = arguments.length,
      r = a < 3 ? e : null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, i);else for (var s = t.length - 1; s >= 0; s--) {
    (n = t[s]) && (r = (a < 3 ? n(r) : a > 3 ? n(e, o, r) : n(e, o)) || r);
  }
  return a > 3 && r && Object.defineProperty(e, o, r), r;
};

Object.defineProperty(o, "__esModule", {
  value: !0
});

var r = t("Global"),
    s = t("RedPointControl "),
    l = cc._decorator,
    c = l.ccclass,
    d = l.property,
    h = function (t) {
  function e() {
    var e = null !== t && t.apply(this, arguments) || this;
    return e.keyArr = [], e.calKey = r.RedPointCalKey.MIN, e.redSprite = null, e;
  }

  return n(e, t), e.prototype.onLoad = function () {
    this.redSprite || (this.redSprite = this.node), this.node.dispatchEvent, s.RedPointControl.getInstance().cal(this.calKey);
  }, e.prototype.onEnable = function () {
    var t = this;
    this.updateUI(), this.schedule(function () {
      t.updateUI();
    }, 3);
  }, e.prototype.updateUI = function () {
    for (var t in this.keyArr) {
      var e = this.keyArr[t];
      if (s.RedPointControl.getInstance().isShow(e)) return void (this.redSprite.active = !0);
    }

    this.redSprite.active = !1;
  }, a([d({
    type: [cc.Enum(r.RedPointKey)],
    tooltip: "红点条件key值"
  })], e.prototype, "keyArr", void 0), a([d({
    type: cc.Enum(r.RedPointCalKey),
    tooltip: "红点计算key值"
  })], e.prototype, "calKey", void 0), a([d(cc.Node)], e.prototype, "redSprite", void 0), a([c], e);
}(cc.Component);

o["default"] = h;

cc._RF.pop();